package src.dp.entire_bag;

import java.util.Scanner;

public class kama57 {//爬楼梯(步数不限制)，完全背包求排列数
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();//楼梯共 n 阶，即为背包容量
        int m = sc.nextInt();//每次能上 m 阶，即物品种数
        int[] dp = new int[n + 1];
        dp[0] = 1;
        //先背包后物品，求排列
        for(int j =1; j <= n; j++){
            for(int i = 1; i <= m; i++){

                if(j >= i){
                    dp[j] += dp[j - i];
                }

            }
        }
        System.out.println(dp[n]);
    }
}
